home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / doslynx / inc / turlview.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  3.2 KB  |  114 lines

  1. #ifndef __TURLVIEW_H
  2. //    Avoid include redundancy
  3. #define __TURLVIEW_H
  4.  
  5. //    Copyright (c) 1993, University of Kansas, All Rights Reserved
  6. //
  7. //    Include File:    turlview.h
  8. //    Purpose:    Class declaration of TURLView
  9. //    Remarks/Portability/Dependencies/Restrictions:
  10. //    Revision History:
  11. //        12-27-93    created
  12.  
  13. //    Constant defines
  14. #define Uses_TScroller
  15. #define Uses_TRect
  16. #define Uses_TEvent
  17.  
  18. //    Required includes
  19. #include<tv.h>
  20. #ifdef __STDARG_H    //    This to avoid an include error directive
  21. #undef __STDARG_H    //    That is not needed in turlvie9.cpp
  22. #endif // __STDARG_H
  23. #include"gridtext.h"
  24. #include"textattr.h"
  25. #include"ttempnam.h"
  26.  
  27. //    Class declarations
  28. extern "C"    {
  29. //    Ensure struct is a "C" structure.  No extras.
  30. struct Line    {
  31.     signed short int ssi_indent;
  32.     signed short int ssi_length;
  33. };
  34. };
  35.  
  36. class TURLView : public TScroller    {
  37. public:
  38.     TURLView(const TRect& TR_bounds, TScrollBar *TSB_x, TScrollBar *TSB_y,
  39.         const char *cp_URL, const char *cp_Index = NULL);
  40.     ~TURLView();
  41.     Boolean valid(unsigned short int usi_command);
  42.     void draw();
  43.     void scrollDraw();
  44.     void handleEvent(TEvent& TE_event);
  45.     const char *getTitle();
  46.     char *getURL();
  47.     char *getChild();
  48.     void registerText(HText *HTp_doc);
  49.     Boolean selectAnchor(HTChildAnchor *HTCAp_anchor);
  50.     virtual void shutDown();
  51.     Boolean isIndex();
  52.     void DoNotDisplay();
  53.     void isImage(const char *cp_imagefile);
  54.     Boolean isDownload();
  55. private:
  56.     Boolean B_download;
  57.     Boolean B_valid;
  58.     Boolean loadURL(const char *cp_URL, const char *cp_Index = NULL);
  59.     void LoadChild();
  60.     void LoadParent();
  61.     unsigned short int HTMLColor(signed long int sli_chars, unsigned
  62.         short int usi_colorindex);
  63.     void AnchorInView();
  64.     Boolean AnchorSelectXYView(signed short int ssi_x, signed short int
  65.         ssi_y);
  66.     void AnchorSelectNext();
  67.     void AnchorSelectPrevious();
  68.     HText *HTp_HyperDoc;
  69.     TextAttribute *TAp_selected;
  70.     TTempName *TTNp_temp;
  71.     fstream *fsp_temp;
  72.     void FormatHTML();
  73.     void blank_lines(signed short int ssi_blanks);
  74.     void beginAnchor(const HTChildAnchor *HTCAp_anchor);
  75.     void endAnchor();
  76.     void appendCharacter(char c_append);
  77.     void adjustSelected();
  78.     void split_line(signed short int ssi_cutoff);
  79.     Line *L_last, *L_new;
  80.     Boolean B_line_1;
  81.     signed short int ssi_splitAt;
  82.     HTStyle *HTSp_style;
  83.     TNSCollection *TNSCp_lines;
  84.     TNSCollection *TNSCp_anchors;
  85.     fstream *fsp_image;
  86.     Boolean B_avoidinfinite;
  87.     HTChildAnchor *HTCAp_2BSelected;
  88.     Boolean B_lastSpace;
  89.     Boolean B_collapseSpaces;
  90.     void save(const char *cp_filename = NULL, const Boolean B_appendff =
  91.         False);
  92.     void print();
  93.     void search(const char *cp_searchFor = NULL);
  94.     unsigned short int usi_lastSearchLine;
  95.     unsigned short int usi_lastSearchOffset;
  96.     TextAttribute *TAp_search;
  97.     signed short int ssi_fasterpussycat;
  98.     char *cp_imagename;
  99.     void addToHotList();
  100. };
  101.  
  102. //    Global variable declarations
  103.  
  104. //    Macros
  105. #include"globals.h"
  106.  
  107. #define TextColor (::usia_TextColor[usi_colorindex])
  108. #define AnchorColor (::usia_AnchorColor[usi_colorindex])
  109. #define SelectedColor (::usia_SelectedColor[usi_colorindex])
  110. #define SearchColor (::usia_SearchColor[usi_colorindex])
  111. #define SearchSelectedColor (::usia_SearchSelectedColor[usi_colorindex])
  112.  
  113. #endif // __TURLVIEW_H
  114.